
let token = sessionStorage.getItem("token");
let organ_id = sessionStorage.getItem("organ_id");
let user_id = sessionStorage.getItem("user_id");
let post_id = sessionStorage.getItem("post_id");
//封装查询热词和提案人方法
function getHotandUsers(searchValue, parents, classname, target) {
    let str2 = "";
    let str4 = "<option value=\"\">-请选择-</option>";
    $.each(searchValue, function (index, value) {
        str2 += " <div  class=\"am-panel am-panel-default\">\n" +
            "                                <div style=\"background-color:#e7f0fa;\"  class=\"am-panel-hd\">\n" +
            "                                    <h4 class=\"am-panel-title\" data-am-collapse=\"{parent: '#" + parents + "', target: '#" + value.id + "" + target + "'}\">\n" +
            "                                        " + value.name + "\n" +
            "                                    </h4>\n" +
            "                                </div>\n" +
            "                                <div id=\"" + value.id + "" + target + "\" class=\"am-panel-collapse am-collapse " + classname + "\">\n" +
            "                                    <div class=\"am-panel-bd " + classname + "\">\n";
        if (value.list === null) {
        } else {
            $.each(value.list, function (index, values) {
                str2 += " <div class=\"item\"><input onchange=\"getItem(this)\" name=\"users\" realId=\"" + values.id + "\" value=\"" + values.name + "\" type=\"checkbox\" id=\"" + values.id + "" + target + "\"><label for=\"" + values.id + "" + target + "\">" + values.name + "</label></div>\n"
            });
        }
        str2 += "                                    </div>\n" +
            "                                </div>\n" +
            "                            </div>";
        str4 += "<option value=\"" + value.id + "\">" + value.name + "</option>"
    });
    let objcet = {};
    objcet.str1 = str2;
    objcet.str3 = str4;
    return objcet;
}
//确定模态框
$("#my-alert").on('close.modal.amui', function () {
    window.location.reload();
});
//框
$("#hotwords").on('close.modal.amui', function () {
    $(".users").html("");
});
//模态框
$("#my-popup").on('close.modal.amui', function () {
    $("#title").val("");
    $("#aditor").val("");
    $("#out_link").val("");
    editor.html("");
    $("#time3").attr("value", "");
    $("#danweiString").val("");
    $("#yonghuString").val("");
    $("#hot_words").html("");
    $("#hot_words2").html("");
});
//封装提交后的提示
function prompt(data, title, modal) {
    if (data.success === true) {
        $(".users").html("" + title + "");
        $(".alert").html(data.message);
        $('#my-alert').modal({ target: '#my-alert' });
        $("#" + modal + "").modal('close');

    } else {
        $(".users").html("" + title + "");
        $(".alert").html(data.message);
        $('#my-alert').modal({ target: '#my-alert' });
        $("#" + modal + "").modal('close');
    }
}
// kindeditor
KindEditor.ready(function (K) {
    editor = K.create('#editor_id', {
        uploadJson: testurl + 'kindeditor/'

    });
});
$(function () {


    if (post_id != "5") {
        $(".access").remove();
        $("#form4").remove();
    }

    //数据字典
    let nian = "<option value=\"\">年份</option>";
    $.ajax({
        url: testurl + "dictionary/list_by_type",
        type: "post",
        headers: { "Authorization": "Bearer " + token },
        contentType: "application/json",
        data: JSON.stringify({
            "type": "nian"
        }),
        success:function(data){
            $.each(data.obj,function(index,value){
                nian += "<option value=\""+value.value_+"\">"+value.text_+"</option>";
            })
            $("#nian").html(nian);
        }
    })


    //分页
    let pageNum = 1;
    $(".first").click(function () {
        pageNum = 1;
        loadData(pageNum);
        $(this).parents("li").addClass("am-active");
        $(this).parents("li").siblings().removeClass("am-active");
    });
    $(".last").click(function () {
        pageNum = pages;
        loadData(pageNum);
        $(this).parents("li").addClass("am-active");
        $(this).parents("li").siblings().removeClass("am-active");
    });
    $(".up").click(function () {
        if (pageNum === 1) {
            return false;
        } else {
            pageNum--;
            loadData(pageNum);
        }
        $(this).parents("li").addClass("am-active");
        $(this).parents("li").siblings().removeClass("am-active");
    });
    $(".down").click(function () {
        if (pageNum === pages) {
            return false;
        } else {
            pageNum++;
            loadData(pageNum);
        }
        $(this).parents("li").addClass("am-active");
        $(this).parents("li").siblings().removeClass("am-active");
    });

    $(".go_page_search1").click(function () {
        pageNum = $(".go_page_1").val().trim();
        if (isNaN(pageNum) || pageNum == "") {
            $(".show_desc").html("只能为数字");
            $('#my-alert').modal({ target: '#my-alert' });
            $(".go_page_c").val("")
            return
        }
        loadData(pageNum);
        $(".go_page_c").val("");
    })


     status = $("input[name='shenhe']:checked").val();
    //筛选审核
    $("input[name='shenhe']").on("change", function () {
        status = $(this).attr("value");
        loadData(1);
    });
     
    $("#nian").on("change", function () {
        year = $("option:selected",this).val();
        loadData(1);
    });
    $("#pageSize").on("change", function () {
        pageSize = $("option:selected",this).val();
        loadData(1);
    });
    $("#search").click(function(){
        condition = $("#input").val();
        loadData(1);
    })
    loadData(1);
    let user_ids = [];
    let checkedLength = "";
    $("#dbdelete").click(function () {
        $.each($('#show input:checkbox:checked'), function () {
            let userId = $(this).val();

            user_ids.push(userId);
        });
        checkedLength = $('#show input:checkbox:checked').length;
        if (checkedLength <= 0) {
            alert("请选中至少一条社情民意！");
            return false;
        } else {
            $.ajax({
                url: testurl + "duty/record/deletes",
                type: "post",
                headers: { "Authorization": "Bearer " + token },
                contentType: "application/json",
                data: JSON.stringify({
                    "ids": user_ids //id数组
                }),
                success: function (data) {
                    prompt(data, "删除社情民意", "")
                }
            })
        }
    });
    $("#receive_users").click(function () {
        // $("#addYonghu").show();
        // $("#addDanwei").hide();
        // $("#isuser").val("1");
        $("#hotwords").modal();

        $(".ifelse").val("0");
        $(".receive_title").html("请选择独立提交委员");

        $.ajax({
            async:false,
            url: testurl + "motion/teamsAndUsers",
            type: "post",
            headers: { "Authorization": "Bearer " + token },
            contentType: "application/json",
            data: JSON.stringify({
                "realname": "",//委员姓名
                "deputy_no": "",//委员证号
                "deputy_team": ""//委员团组
            }),
            success: function (data) {
                let hotwords = data.obj;
                let parents = "hotwordsList";
                let classname = "hotwords";
                let target = "222";
                if (hotwords === null) {
                } else {
                    let obj = getHotandUsers(hotwords, parents, classname, target);
                    $(".hotwords").html(obj.str1);
                    $("#hwfenlei").html(obj.str3);
                }
            }
        })


        $("#hot_words input[name='waihots']:checked").each(function () {
            var _this = this;
            $("input[name='users']").each(function () {
                if ($(_this).attr("value") == $(this).attr("realId")) {
                    $(this).prop("checked", true);
                    $(this).attr("checked", true);
                    getItem($(this)[0]);
                }
            })
        })
   
    })
    $("#receive_organs").click(function () {
        // $("#addDanwei").show();
        // $("#addYonghu").hide();
        // $("#isuser").val("2");
        $("#hotwords").modal();

    
        $(".ifelse").val("1");
        $(".receive_title").html("请选择联名提交委员");
        $.ajax({
            async: false,
            url: testurl + "motion/teamsAndUsers",
            type: "post",
            headers: { "Authorization": "Bearer " + token },
            contentType: "application/json",
            data: JSON.stringify({
                "realname": "",//委员姓名
                "deputy_no": "",//委员证号
                "deputy_team": ""//委员团组
            }),
            success: function (data) {
                let hotwords = data.obj;
                let parents = "hotwordsList";
                let classname = "hotwords";
                let target = "222";
                if (hotwords === null) {
                } else {
                    let obj = getHotandUsers(hotwords, parents, classname, target);
                    $(".hotwords").html(obj.str1);
                    $("#hwfenlei").html(obj.str3);
                }
            }
        })
        $("#hot_words2 input[name='waihots']:checked").each(function () {
            var _this = this;
            $("input[name='users']").each(function () {
                if ($(_this).attr("value") == $(this).attr("realId")) {
                    $(this).prop("checked", true);
                    $(this).attr("checked", true);
                    getItem($(this)[0]);
                }
            })
        })
    })

    //导出excel
    let testurlexcel = testurl + "duty/record/export?";
    let checkedId = [];
    let checkedLength2 = "";
    $("#excel").click(function () {


        $('#table input[name="selectAll"]:checked').each(function () {
            checkedId.push($(this).val());

        });
        let ids = checkedId.toString();
        
        
       if(condition === undefined){
           condition = "";
       }
       if(year === undefined){
           year = "";
       }
        window.open(testurlexcel + "year=" + year + "&&title=" + condition + "&&status=" + status + "&&ids=" + ids);
 
            // window.open(testurlexcel + "ids=" + checkedId.toString());
       
    });
    //审核
    $("#allAssign").click(function(){
        let status = $("input[name='fun2']:checked").val();
        let check_cause = $("#rds_assign_remark3").val();
        $('#table input[name="selectAll"]:checked').each(function () {
            checkedId.push($(this).val());
        });
        let ids = checkedId.toString();
         checkedLength2 = $('#table input[name="selectAll"]:checked').length;
         if(checkedLength2 <=0) {
             alert("请选择要审核的社情民意！");
             return false;
         }else{
             if(status === "" || status === undefined){
                 alert("请选择审核是否通过!");
                 return false;
             }
             $.ajax({
                 url: testurl + "duty/record/check",
                 type: "post",
                 headers: { "Authorization": "Bearer " + token },
                 contentType: "application/json",
                 data: JSON.stringify({
                     "ids": ids,
                     "status": status,//2通过 3不通过
                     "check_cause": check_cause
                 }),
                 success:function(data){
                     prompt(data,"成功","");
                 }
             })
         }
    });


    $("input[name='ca']").on("change", function () {
        if ($(this).is(":checked")) {
            $("#hotwords .am-in input").prop("checked", true);
            $("#hotwords .am-in input:checked").each(function () {
                getItem(this);
            })
        } else {
            $("#hotwords .am-in input").removeAttr("checked", true);
            $("#hotwords .users").html("");
        }
    })

});

//页数
let pages = 1;
 let status;
 let year;
 let pageSize;
let condition;
function loadData(pageNum) {

    $.ajax({

        url: testurl + "duty/record/list",
        type: "post",
        headers: { "Authorization": "Bearer " + token },
        contentType: "application/json",
        data: JSON.stringify({
            "pageNum": pageNum,
            "pageSize":pageSize,
            "status": status,//状态 1待审核 2审核通过 3不通过 不传查全部
            "use_status": "",//采用情况 1采用 2不采用 不传查全部
            "year": year,//年份
            "condition": condition
        }),
        success: function (data) {
            let dbmessage = data.obj;
            ssd = Math.ceil(data.pageTotal / data.pageSize);
            pages = ssd;
            str = "";
            $.each(dbmessage, function (index, values) {
                if (values.no === undefined) {
                    values.no = "";
                }
                if (values.author === undefined) {
                    values.author = "";
                }
                if (values.check_cause === undefined) {
                    values.check_cause = "";
                }
                if (values.deputy_team_name === undefined) {
                    values.deputy_team_name = "";
                }
                str += " <tr class=\"gradeX\">\n" +
                    "                                        <td>" + (index + 1) + "</td>\n" +
                    "                            <td ><input name='selectAll'  class='checked' value=" + values.id + " type='checkbox'></td>\n" +
                    "                                        <td><a style=\"cursor:pointer\" data-am-modal=\"{target:'#modal1'}\" onclick=\"getMsg(" + values.id + ")\">" + values.title + "</a></td>\n" +
                    "                                        <td>" + values.no + "</td>\n" +
                    "                                        <td>" + values.author + "</td>\n" +
                    "                                        <td>" + values.deputy_team_name + "</td>\n" +
                    "                                        <td>" + values.duty_date + "</td>\n" +
                    "                                        <td>" + values.use_status_name + "</td>\n" +
                    "                                        <td>" + values.create_user_name + "</td>\n" +
                    "                                        <td>" + values.create_times + "</td>\n"+
                     "      <td>\n" +
                    "    <button class=\"btnImg60 quan_xian\"rules=\"she_xiu\" data-am-modal=\"{target: '#my-popup'}\"  onclick='editor1(" + values.id + ");'>修改</button>\n" +

                    "    <button class=\"btnImg60\"  data-am-modal=\"{target: '#modal1'}\"  onclick='getMsg(" + values.id + ");'>查看</button>\n" +
                            "     </td>\n"+
                     "                                        <td>" + values.check_cause + "</td>\n";

             

                    "                                    </tr>";

            });
            $("#show").html(str);
            $(".pagenum_1").html(pages);
            if (pageNum >= pages) {
                pageNum = pages
            }
            $(".strip_1").html(data.pageSize);
            $(".page_1").html(pageNum);
            rules(); 
        }
    });
}


//下面取消选中
function cancelCheck(obj) {
    let aa = $(obj).attr("value");
    $("input[name='users']:checked").each(function () {
        if (aa == $(this).attr("realId")) {
            $(this).removeAttr("checked", true);
        }
    });
    $(".hidelabel").each(function () {
        if (aa == $(this).attr("value")) {
            $(this).remove();
        }
    });
    $(obj).remove();

}
//添加委员到列表
function getItem(obj) {
    let only = $(".ifelse").val();
    if (obj.checked) {
        if (only === "0") {
            $(".users").append("<label value=\"" + obj.id + "\" class=\"span" + obj.id + "\">" + obj.value + "</label>&nbsp;&nbsp;");
            $("input[name='users']:not(:checked)").attr("disabled", "")
        } else {
            $(".users").append("<input value=\"" + $(obj).attr("realId") + "\" onclick=\"cancelCheck(this)\" class=\"" + obj.value + " span" + obj.id + "\" checked name=\"xuanzhong\" type=\"checkbox\"><label value=\"" + $(obj).attr("realId") + "\" class=\"hidelabel span" + obj.id + "\">" + obj.value + "</label>&nbsp;&nbsp;");
        }
    } else {
        $(".span" + obj.id).remove();
        $("input[name='users']").removeAttr("disabled");
    }
}
//查询热词
function searchReci() {
    let realname = $("#hw").val();
   
    let deputy_team = $("#hwfenlei").val();
    $.ajax({
        url: testurl + "motion/teamsAndUsers",
        type: "post",
        headers: { "Authorization": "Bearer " + token },
        contentType: "application/json",
        data: JSON.stringify({
            "realname": realname,//代表姓名
            "deputy_no": "",//代表证号
            "deputy_team": deputy_team//代表团
        }),
        success: function (data) {
            let searchValue = data.obj;
            let parents = "searchResult";
            let classname = "deputyteam";
            let target = "444";
            let obj = getHotandUsers(searchValue, parents, classname, target);
            $("#hotwordsResult").html(obj.str1);
        }
    })
}
//添加人
function addUsers() {
    let str5 = "";
    let hot = [];
     if ($(".ifelse").val() === "0") {
        $("#hot_words input").remove();
        $("#hot_words span").remove();
        $("[name='users']").each(function () {
            if ($(this).is(':checked')) {
                hot.push($(this).attr("id"));
                str5 += "<input style=\"height:13px;\" value=\"" + $(this).attr("realId") + "\" name=\"waihots\" checked type=\"checkbox\"><span style=\"color: #000000;font-size: 14px;\" class=\"reci\" value=\"" + $(this).attr("realId") + "\">" + $(this).attr("value") + "</span>";
            }
        });
      
        $("#hot_words").html(str5);

     } else if ($(".ifelse").val() === "1") {
         $("#hot_words2 input").remove();
         $("#hot_words2 span").remove();
         $("[name='users']").each(function () {
             if ($(this).is(':checked')) {
                 hot.push($(this).attr("id"));
                 str5 += "<input style=\"height:13px;\" value=\"" + $(this).attr("realId") + "\" name=\"waihots\" checked type=\"checkbox\"><span style=\"color: #000000;font-size: 14px;\" class=\"reci\" value=\"" + $(this).attr("realId") + "\">" + $(this).attr("value") + "</span>";
             }
         });
         $("#hot_words2").html(str5);

     }
        
      
    $("input[name='users']").removeAttr("checked");
    $("input[name='users']").removeAttr("disabled");
    str5 = "";
    $(".users").html("");

    $('#hotwords').modal('close');
}


//添加接收人
function addYonghu() {
    let users = [];
    let user_ids = [];
    $("#receive_ input[type='checkbox']:checked").each(function () {
        let aaa = $(this).attr("value");
        let bbb = $(this).attr("id");
        users.push(aaa);
        user_ids.push(bbb);
    });
    $("#receive_reb").html(users.toString());
    $("#yonghuString").val(user_ids.toString());
    $("#receive").modal('close');
    $("#checkAll2").removeAttr("checked", true);
}
//添加接收单位
function addDanwei() {
    let users = [];
    let user_ids = [];
    $("#receive_ input[type='checkbox']:checked").each(function () {
        let aaa = $(this).attr("value");
        let bbb = $(this).attr("id");
        users.push(aaa);
        user_ids.push(bbb);
    });
    $("#receive_reb2").html(users.toString());
    $("#danweiString").val(user_ids.toString());
    $("#receive").modal('close');
    $("#checkAll2").removeAttr("checked", true);
}


//选中所有的checkbox框
$('#checkAll[name="selectAll"]').click(function () {
    if ($(this).is(':checked')) {
        $('#show input[name="selectAll"]').each(function () {

            $(this).prop("checked", true);
        });
    } else {
        $('input[name="selectAll"]').each(function () {
            $(this).removeAttr("checked", false);
        });
    }
});

//选中所有的checkbox框
$('#checkAll2[name="selectAll2"]').click(function () {
    if ($(this).is(':checked')) {
        $("#receive_ input[type='checkbox']").each(function () {

            $(this).prop("checked", true);
        });
    } else {
        $("#receive_ input[type='checkbox']").each(function () {
            $(this).removeAttr("checked", false);
        });
    }
});




// 添加新闻
function submitMsg() {
    // 图片上传
    let file_path = "";
    let file_name = "";
    let formData = new FormData();
    let pic1 = document.getElementById("fileUpload1").files;
    formData.append("0",pic1[0]);
  
    $.ajax({
        url: testurl + "duty/record/file",
        type: 'post',
        headers: { "Authorization": "Bearer " + token },
        data: formData,
        async: false,
        cache: false,
        contentType: false,
        processData: false,
        success: function (data) {
            console.log(data)
            if (pic1[0] != undefined && pic1[0].name != '') {
                $("#upfile1").attr("name", data.obj[0].name);
                $("#upfile1").attr("path", data.obj[0].path);
            }
            file_path = data.obj[0].path;
            file_name = data.obj[0].name;

        },
        error: function (data) {
            console.log(data);
        }
    });
   

    let title = $("#title").val();
    let author = $("#aditor").val();
    let duty_date = $("#time3").val();
    let content = editor.html();
    let joiners = $("#hot_words input[name='waihots']:checked").val();
    let absenter = [];
    $("#hot_words2 input[name='waihots']:checked").each(function () {

        absenter.push($(this).attr('value'))
    });
    let absenters = absenter.toString();
    if (title === "" || content === "" || duty_date === "") {
        alert("请填写必填项！");
        return false;
    } else {
            $.ajax({
                async: false,
                url: testurl + "duty/record/",
                type: "post",
                headers: { "Authorization": "Bearer " + token },
                contentType: "application/json",
                data: JSON.stringify({
                    "title": title,//标题
                    "path": file_path,
                    "name": file_name,
                    "author": author,
                    "content": content,
                    "duty_date": duty_date,
                    "joiners": joiners,//接收人id串
                    "absenters": absenters//接收单位id串
                }),
                success: function (data) {
                    prompt(data, "添加社情民意", "my-popup")
                }
            })
       


    }


}
//修改
function editor1(e) {

    $("#getId").val(e);
    $("#add").hide();
    $("#rechange").show();
    $("#file1").show();
    $("#file2").show();
    let str2 = "";
    let str3 = "";
    $.ajax({
        url: testurl + "duty/record/detail",
        type: "post",
        headers: { "Authorization": "Bearer " + token },
        contentType: "application/json",
        data: JSON.stringify({
            "id": e
        }),
        success: function (data) {
            console.log(data);
            let aaa = data.obj;
            if (aaa.file_name === undefined || aaa.file_path === undefined) {
                $("#file1").html();
            } else {
                $("#file1").html("<a style=\"color: blue\" target=\"_blank\" href=\"" + testurl + "" + aaa.file_path + "\">" + aaa.file_name + "</a><input style=\"height: 13px\" type=\"checkbox\" name=\"check1\"  >删除");
                $("#upfile1").attr("name", aaa.file_name);
                $("#upfile1").attr("path", aaa.file_path);
            }
        
            $("#title").val(aaa.title);
            $("#aditor").val(aaa.author);
            $("#out_link").val(aaa.out_link);
            editor.html(aaa.content);
            $.each(data.obj.joinerList, function (index, value) {
                // linker
                str2 += "<input style=\"height: 13px;\" value=\"" + value.user_id + "\" name=\"waihots\" checked type=\"checkbox\"><span style=\"color: #000000; font - size: 14px;\" class=\"jianyi\" value=\"" + value.user_id + "\">" + value.realname + "</span>"
            });
            $("#hot_words").html(str2);
            $("#time3").attr('value', aaa.duty_date);
            $.each(data.obj.absenterList, function (index, value) {
                // linker
                str3 += "<input style=\"height: 13px;\" value=\"" + value.user_id + "\" name=\"waihots\" checked type=\"checkbox\"><span style=\"color: #000000; font - size: 14px;\" class=\"jianyi\" value=\"" + value.user_id + "\">" + value.realname + "</span>"
            });
            $("#hot_words2").html(str3);
        }
    })
}
//清楚文件
function clearFile() {
    $("#file1").hide();
    $("#file2").hide();
    $("#add").show();
    $("#rechange").hide();
}
//修改
function rechangeMsg() {

    let id = $("#getId").val();
    let title = $("#title").val();
    let author = $("#aditor").val();
    let duty_date = $("#time3").val();
    let content = editor.html();
    // 图片上传
    let file_path = "";
    let file_name = "";
    let formData = new FormData();
    let pic1 = document.getElementById("fileUpload1").files;

    formData.append("0",pic1[0]);
    $.ajax({
        url: testurl + "duty/record/file",
        type: 'post',
        headers: { "Authorization": "Bearer " + token },
        data: formData,
        async: false,
        cache: false,
        contentType: false,
        processData: false,
        success: function (data) {
            console.log(data)
            if (pic1[0] != undefined && pic1[0].name != '') {
                $("#upfile1").attr("name", data.obj[0].name);
                $("#upfile1").attr("path", data.obj[0].path);
            }
            file_path = data.obj[0].path;
            file_name = data.obj[0].name;
        },
        error: function (data) {
            console.log(data);
        }
    });
   

    if ($("#upfile1").attr("path") != '') {
        if ((pic1[0] == undefined || pic1[0].name == '') && ($("input[name='check1']").length == 0 || $("input[name='check1']")[0].checked)) {
        } else {
            file_name = $("#upfile1").attr("name");
            file_path = $("#upfile1").attr("path");

        }
    }
    let joiners = $("#hot_words input[name='waihots']:checked").val();
    let absenter = [];
    $("#hot_words2 input[name='waihots']:checked").each(function () {

        absenter.push($(this).attr('value'))
    });
    let absenters = absenter.toString();

    $.ajax({
        url: testurl + "duty/record/update",
        type: "post",
        headers: { "Authorization": "Bearer " + token },
        contentType: "application/json",
        data: JSON.stringify({
            "id": id,
            "title": title,//标题
            "path": file_path,
            "name": file_name,
            "author": author,
            "content": content,
            "duty_date": duty_date,
            "joiners": joiners,//接收人id串
            "absenters": absenters//接收单位id串
        }),
        success: function (data) {
            prompt(data, "修改社情民意", "my-popup")
        }
    })
}
//标题点开
function getMsg(e) {
    let str = "";
    $.ajax({
        url: testurl + "duty/record/detail",
        type: "post",
        headers: { "Authorization": "Bearer " + token },
        contentType: "application/json",
        data: JSON.stringify({
            "id": e
        }),
        success: function (data) {
            $(".printLook").attr("href", "sqmyPrint.html?id=" + e + "");
            console.log(data);
            $("#rtitle").html(data.obj.title);
            $("#rno").html(data.obj.no);
            $.each(data.obj.absenterList,function(index,value){
                str += "<span>"+value.realname+"</span>&nbsp;"
            })
            $("#rlian").html(str);
            $("#rleader").html(data.obj.author);
            $("#rdate").html(data.obj.duty_date);
            $("#rqing").html("");
            if(data.obj.file_name === undefined){
                data.obj.file_name = "";
            }
            $("#rfu").html("<a download href=\""+testurl+""+data.obj.file_path+"\">"+data.obj.file_name+"</a>");
          
            $("#rcontent").html(data.obj.content);

        }
    })
}
